//
//  NSDictionary+Tools.h
//  MiaoPai
//
//  Created by jiaxuzhou on 2017/6/10.
//  Copyright © 2017年 Jeakin. All rights reserved.
//
//


#import <Foundation/Foundation.h>
#import "NSObject+Tools.h"


/// 字典保护
/// 是否NSDictionary类型
#define MPT_Dic_Class(dic) MPT_Object_Is_Class(dic,[NSDictionary class])

/// 是否有效，不为空，且是NSDictionary类型，且count值大于0
#define MPT_Dic_Is_Valid(dic) ((MPT_Object_Not_Null(dic)) && (MPT_Dic_Class(dic)) && (dic.count > 0))
/// 是否有效，不为空，且是NSDictionary类型
#define MPT_Dic_Is_Valid_ExceptEmpty(dic) ((MPT_Object_Not_Null(dic)) && (MPT_Dic_Class(dic)))


/// 是否无效，或为空，或不是NSDictionary类型，或count值小于等于0
#define MPT_Dic_Not_Valid(dic) ((MPT_Object_Is_Null(dic)) || (!MPT_Dic_Class(dic)) || (dic.count <= 0))
/// 是否无效，或为空，或不是NSDictionary类型
#define MPT_Dic_Not_Valid_ExceptEmpty(dic) ((MPT_Object_Is_Null(dic)) || (!MPT_Dic_Class(dic)))
/// 获取字典元素保护
#define MPT_Dic_GetValidObjectFromDictionary(dic,key) mp_getValidObjectFromDictionary(dic,key)


@interface NSDictionary (Tools)


/**
 

 @return <#return value description#>
 */
- (NSString *)mp_buildHttpQueryString;

id mp_getValidObjectFromDictionary(NSDictionary *dic, id key);


@end
